package com.system.user.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.system.user.dao.PayDao;
import com.system.user.entity.PayEntity;
import com.system.user.entityVO.PayVO;
import com.system.user.service.PayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("payService")
public class PayServiceImpl implements PayService {

    @Autowired
    private PayDao payDao;

    @Override
    public boolean add(PayEntity pay) {
        if (payDao.insertPay(pay) > 0) {
            return true;
        }
        return false;
    }

    @Override
    public boolean payment(Integer id) {
        if (payDao.payment(id) > 0) {
            return true;
        }
        return false;
    }

    @Override
    public List<PayEntity> queryByUid(Integer uid) {
        return payDao.selectByUid(uid);
    }

    @Override
    public List<PayVO> queryByParam(PayVO pay) {
        return payDao.queryByParam(pay);
    }
}
